package com.uchiha.nova.mainService.controller;


import com.uchiha.nova.core.tool.api.R;

import com.uchiha.nova.mainService.service.UploadFileToHuaweiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Nullable;
import java.io.IOException;

/**
 * @Author 周林静
 * @Date 2023/7/27 16:20
 * @Version 1.0
 */
@RestController
@RequestMapping("/thirdparty/obs")
public class ObsController {
    @Autowired
    UploadFileToHuaweiService uploadFileToHuaweiService;



    @PostMapping("/uploadImage")
    public R uploadImage(@RequestParam(name = "file") MultipartFile file,@RequestParam(name = "name",required = false) @Nullable String name,@RequestParam(name = "path",required = false) @Nullable String path){
        return uploadFileToHuaweiService.uploadImage(file,name,path);
    }


}